CarouselView

open class CarouselView : LinearLayout, RevelControl, PlayedHandler

A custom view that displays a collection of image sources in a carousel-style interface, typically using a ViewPager with a cover flow effect.

CarouselView manages a playlist of Source objects, specifically filtering for image types. It handles automatic playback, navigation (next/previous), and allows listeners to be notified of playback events.

This view implements RevelControl to integrate with a broader playback system and PlayedHandler to manage notifications when a source has been played.

See also

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet)
Constructor for inflating from XML.
constructor(context: Context, attrs: AttributeSet, defStyle: Int)
Constructor for inflating from XML with a default style.
constructor(context: Context, module: Module)
Programmatic constructor.

Properties

Link copied to clipboard
open val isStarted: Boolean

Functions

Link copied to clipboard
Registers a listener to be notified of playlist events.
Link copied to clipboard
open fun dispose()
Performs any cleanup required when this view is being disposed of.
Link copied to clipboard
open fun getName(): String
Gets the unique name assigned to this control.
Link copied to clipboard
open fun getOptions(): Iterator<out Option>
Gets an iterator over the configuration Options for this control.
Link copied to clipboard
open fun getPlaylist(): Playlist
Gets the Playlist associated with this control, if any.
Link copied to clipboard
open fun getSource(): Source
Retrieves the currently active or displayed source in the carousel.
Link copied to clipboard
open fun getType(): ModuleType
Gets the type of the underlying module or content associated with this control.
Link copied to clipboard
open fun getZIndex(): Int
Gets the Z-index (stacking order) of this control.
Link copied to clipboard
open fun initialize(module: Module)
Initializes the CarouselView with module data.
Link copied to clipboard
open fun isAutoStart(): Boolean
Checks if this control is configured to start its operation automatically after initialization.
Link copied to clipboard
open fun next()
Advances the carousel to display the next image source in the playlist.
Link copied to clipboard
open fun previous()
Moves the carousel to display the previous image source in the playlist.
Link copied to clipboard
open fun registerPlayedListener(listener: PlayedListener)
Registers a listener to be notified when a source has been considered "played".
Link copied to clipboard
Unregisters a previously added playlist listener.
Link copied to clipboard
open fun setAutoStart(flag: Boolean)
Sets whether this control should start its operation automatically after initialization.
Link copied to clipboard
open fun setSource(source: Source)
Sets and plays the specified Source in the playlist.
open fun setSource(idx: Int)
Sets and plays the source specified by its index in the playlist.
open fun setSource(source: Source, play: Boolean)
Sets the current source, with an option to control immediate playback.
open fun setSource(idx: Int, play: Boolean)
Sets the current source by its index in the playlist, with an option to control immediate playback.
Link copied to clipboard
open fun start()
Starts the automatic playback of the carousel.
Link copied to clipboard
open fun stop()
Stops the automatic playback of the carousel.